Conversation
|
Still having trouble figuring out why |
20d5703 to
9d6265e
Compare
|
I figured out the Anyway, by switching it out to So aside from the network message version switching, this is working as it should I believe. |
hannahhoward
left a comment
There was a problem hiding this comment.
This is pretty great-- it's nice to see this overall wasn't that bad. I'm excited you have passing tests. I think we should create an epic branch to track the new protocol and do merges to that? I'll discuss with @mvdan and we can figure it out. I realize epic branchs are a pain in the but I know we're going to ship things while all this work is still outstanding.
| requestRecordChan <-chan requestRecord, | ||
| count int) []requestRecord { | ||
| requestRecords := make([]requestRecord, 0, count) | ||
| func readNNetworkRequests(ctx context.Context, t *testing.T, td *testData, count int) []requestRecord { |
There was a problem hiding this comment.
oh the simplied sorting in this method is a sad state of affairs.... your correction works, but I wonder how I ended writing the tests this way to count on sorting order
f54bf67 to
bb7ceb1
Compare
d7ffdcf to
482dd21
Compare
|
@hannahhoward see latest commit for my first pass at protocol switching and compatibility: f7ce568 No tests yet that exercise v1.0.0. |
|
Pushed another commit that adds testing, but failing testing. Fixed a few other things along the way. But I think the main problem is the lack of differentiation between the integer ID space for requests and responses. So I need to figure out a nice way to do that. |
|
so baseline: this looks reasonable. The MessageHandler is a good abstraction. But two caveats, one big, one small: Big: To uniquely identify the OLD requests you need the peer ID && the integer request ID. So, for your MessageHandler, you need the following maps: The translation is:
Beyond distinguishing requests & responses, if we are talking to old client A & old client B, it's entirely possible both could send you a request with the same integer ID.
|
|
also, in terms of where to get the other peer.ID and the self peer.ID: |
|
sidebar: goodness why did I decide to have so much object orientation initially? I wonder if this would be made much easier if we took all this encoding out of the message package and just made and encode/decode package with functional implementations This is more of a "later problem" than a now problem though so let's defer it. |
|
OK, this is working and ready for review. But it's blocking pending a merge with #323 so that v1.1.0 isn't protobuf but is dag-cbor. |
|
#332 has these commits and more now, it removes the 1.1.0 protocol, adding a 2.0.0 that's dag-cbor with UUIDs and retains the translation layer that was introduced here for 1.1.0 / 1.0.0. |
Ref: #278
Closes: #279
Closes: #281
WIP, first pass. TODO:
TestGraphsyncRoundTripMultipleAlternatePersistence()is failing and I don't yet understand whyreadNNetworkRequests()used int id ordering to properly sort network requests to remove out-of-order effects, can't do that now so we have flakys, need to figure out at way to deal with that.